home *** CD-ROM | disk | FTP | other *** search
- <html>
-
- <head>
-
- <title>Layer Breeder</title>
-
- </head>
-
- <body bgcolor="white">
-
- <script language="Javascript1.2">
-
- <!--//
-
-
-
- //capture MOUSEDOWN events, routing them to the buildLayer function
-
- window.captureEvents(Event.MOUSEDOWN);
-
- window.onmousedown = buildLayer;
-
-
-
- //The buildLayer function takes the mousedown event, and starts
-
- //by creating a new layer object. After dynamically writing the
-
- //html needed for the 'puppy.gif' image, it makes the new layer
-
- //visible, and starts a modified slideTo function that moves it
-
- //to where the user clicked. Again, the MOUSEDOWN event is released
-
- //to ensure that you don't end up overloading your browser with
-
- //fifty or so layers moving at once.
-
-
-
- function buildLayer(e) {
-
- var newPup = new Layer(50);
-
- newPup.document.write("<img src='puppy.gif' width=50 height=50>");
-
- newPup.document.close();
-
- newPup.moveTo(0,0);
-
- newPup.visibility=true;
-
- slideTo(newPup, e.pageY, e.pageX);
-
- window.releaseEvents(Event.MOUSEDOWN);
-
- }
-
-
-
- //This modified slideTo function, in the interest of building new layers
-
- //as fast as possible, just fires until the layer is beyond
-
- //the target coordinate on the screen. Just for kicks, because it's a
-
- //Yorkshire Terrier, and those dogs aren't cheap, it also keeps a running
-
- //tally of your total amount in dogs in the status line by
-
- //multiplying the number of layers in the layers array by $595 :)
-
-
-
- function slideTo(targetLayer, targetTop, targetLeft) {
-
- if((targetLayer.top <= targetTop) || (targetLayer.left <= targetLeft)) {
-
- if (targetLayer.top <= targetTop) targetLayer.top = targetLayer.top + 15;
-
- if (targetLayer.left <= targetLeft) targetLayer.left = targetLayer.left + 15;
-
- setTimeout('slideTo(document.layers["'+targetLayer.name+'"],'+targetTop+','+targetLeft+')',1);
-
- } else {
-
- window.captureEvents(Event.MOUSEDOWN);
-
- n = document.layers.length;
-
- self.status = n + ' Puppies, Total Value : $' + (n * 595);
-
- }
-
- }
-
- //-->
-
- </script>
-
- <body bgcolor="white">
-
-
-
- <layer id="puppy" height=50 width=50 top=0 left=0>
-
- <img src="puppy.gif" border=0 height=50 width=50>
-
- </layer>
-
-
-
- </body>
-
- </html>
-
-